@(pdate: Date)

@dateshow(dateinsert: Date) = @{
  val interval = (new java.util.Date()).getTime() - dateinsert.getTime()
  
  if(interval >= (24*3600*1000)) {
    Messages("common.on")+" "+dateinsert.format("dd/MM/yyyy '"+Messages("common.at")+"' HH'h'mm")
  }
  else if(interval >= (2*3600*1000)){
    Messages("common.since")+" "+(interval/1000/3600)+" "+Messages("common.hours")
  }
  else if(interval >= (3600*1000)){
    Messages("common.since")+" "+(interval/1000/3600)+" "+Messages("common.hour")
  }
  else if(interval >= (2*60*1000)){
    Messages("common.since")+" "+(interval/1000/60)+" "+Messages("common.minutes")
  } 
  else if(interval >= (60*1000)){
    Messages("common.since")+" "+(interval/1000/60)+" "+Messages("common.minute")
  } else {
    Messages("common.since")+" "+(interval/1000)+" "+Messages("common.seconds")
  }
}

@dateshow(pdate)